﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gasco.DataAccess;

namespace Gasco.Business.Services
{
    public interface IPlattService
    {
        IList<platt> GetAll();
        int GetCountAll();
        IList<platt> GetAll(int pageNumber, int pageSize, DateTime startDate, DateTime endDate);
        int GetCountAll(DateTime startDate, DateTime endDate);

        IList<platt> GetByProduct(int productId);
        IList<platt> GetByProduct(int productId, int pageNumber, int pageSize);
        IList<platt> GetByProduct(int productId, int pageNumber, int pageSize, DateTime startDate, DateTime endDate);

        platt GetById(int id);
        platt GetByProductAndDate(int productId, DateTime plattsDate, int platt_type_id);
        platt CheckForDuplicate(int productCategoryId, DateTime plattsDate, int plattsType, int plattsUnit);
        float GetAveragePriceByDate(int productId, int plattsTypeId, DateTime startDate, DateTime endDate);

        void Update(platt p);
        void Delete(int id);
        platt Create(platt p);
        IList<platt> SearchPlatts(string keyword, int pageSize, int pageNumber, string sortBy, string sortDirection);
        int CountSearchPlatts(string keyword);
        IList<platt> SearchDatePlatts(DateTime fromDate,DateTime toDate,int pageSize, int pageNumber, string sortBy, string sortDirection);
        int CountSearchDatePlatts(DateTime fromDate, DateTime toDate);
    }
}
